#include <iostream>

int main() {
    void input(int *number);
    void max_min_value(int * number);
    void output(int * number);
    int number[10];
    input(number);
    max_min_value(number);
    output(number);
    return 0;
}

void input(int *number) {
    int i;
    printf("input 10 numbers:");
    for (i = 0; i < 10; i++) {
        scanf("%d", &number[i]);
    }
}

void max_min_value(int * number) {
    int * max, * min, *p1, *p2, temp;
    max=min=number;
    for (p1 = number + 1;p1 < number + 10; p1++) {
        if (*p1 > *max) max = p1;
    }
    temp = number[0]; number[0] = *min; *min = temp;
    for (p2 = number + 1;p2 < number + 10; p2++) {
        if (*p2 < *max) min = p2;
    }
    temp = number[0]; number[0] = *min; *min = temp;
}

void output(int * number) {
    int *p;
    printf("Now they are: ");
    for (p = number; p < number + 10; p++){
        printf("%d\t", *p);
    }
    printf("\n");
}
